using System.Collections.Generic;
using UnityEngine;

public class ChatInGameMessageStorage : MonoBehaviour
{
	private static Dictionary<ChatWindow.IdChatType, List<ChatInGameUIChatMessage>> _storages = new Dictionary<ChatWindow.IdChatType, List<ChatInGameUIChatMessage>>();

	public static List<ChatInGameUIChatMessage> getMessages(ChatWindow.IdChatType idChat)
	{
		if (!_storages.ContainsKey(idChat))
		{
			_storages[idChat] = new List<ChatInGameUIChatMessage>();
		}
		return _storages[idChat];
	}

	public static List<ChatWindow.IdChatType> GetKesy()
	{
		return new List<ChatWindow.IdChatType>(_storages.Keys);
	}

	public static void ClearAllList()
	{
		foreach (ChatWindow.IdChatType key in _storages.Keys)
		{
			foreach (ChatInGameUIChatMessage item in _storages[key])
			{
				Object.Destroy(item);
			}
		}
		_storages.Clear();
	}
}
